/*
 * Copyright (c) 2024-2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef IOTC_ERRCODE_H
#define IOTC_ERRCODE_H

#include "iotc_def.h"

#ifdef __cplusplus
extern "C" {
#endif

#define ERR_CODE_BASE(module) (-((module) << 16))

enum IotcErrcode {
    IOTC_SDK_AILIFE_DATA_ERR_REG_INFO_NOT_EXISTS = ERR_CODE_BASE(IOTC_SUB_MODULE_SDK_AILIFE),
    IOTC_SDK_AILIFE_BLE_ERR_RELEASE_NOT_COMBO,
    IOTC_SDK_AILIFE_BLE_ERR_CUSTOM_SEC_DATA_SVC_NUM,
    IOTC_SDK_AILIFE_COMM_ERR_EVENT_LISTENER_MAX,
    IOTC_SDK_AILIFE_COMM_ERR_BUILD_DEV_INFO_JSON,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_TOKEN_TIMEOUT_INVALID,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_TLS_GET_SEQ,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_BUILD_OPTION,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_BUILD_REQ_JSON,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_INVALID_ACCESS_TOKEN,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_INVALID_REFRESH_TOKEN,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_INVALID_TOKEN_TIMEOUT,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_TOKEN_EXPIRE,
    IOTC_SDK_AILIFE_WIFI_ERR_CLOUD_INVALID_TIMESTAMP,

    /* SDK模块错误码 [-458752,-393216) */
    IOTC_SDK_MNGR_ERR_MAIN_TASK_NOT_EXISTS = ERR_CODE_BASE(IOTC_SUB_MODULE_SDK),
    IOTC_SDK_MNGR_ERR_MULTI_INVOKE,

    IOTC_CORE_DEVICE_ERR_GET_CHAR_STATE = ERR_CODE_BASE(IOTC_SUB_MODULE_CORE_DEVICE),

    /* 核心ble模块错误码 [-393216,-327680) */
    IOTC_CORE_BLE_ERR_XXX = ERR_CODE_BASE(IOTC_SUB_MODULE_CORE_BLE),
    IOTC_CORE_BLE_LL_ERR_ENCRYPT_TYPE,
    IOTC_CORE_BLE_LL_ERR_SPEKE_NULL,
    IOTC_CORE_BLE_LL_ERR_BODY,
    IOTC_CORE_BLE_LL_ERR_POOL_FULL,
    IOTC_CORE_BLE_LL_ERR_TOKEN,
    IOTC_CORE_BLE_LL_ERR_PKGNUM,
    IOTC_CORE_BLE_LL_ERR_PKGLEN,
    IOTC_CORE_BLE_LL_ERR_SUBPKG_NULL,
    IOTC_CORE_BLE_LL_ERR_SVC_NOT_SUPP_ENCTYPE,
    IOTC_CORE_BLE_LL_ERR_DATA_SEND,
    IOTC_CORE_BLE_LL_ERR_SVC_LEN,
    IOTC_CORE_BLE_LL_ERR_SVC_NUM,
    IOTC_CORE_BLE_LL_ERR_SVC_NOT_FOUND,
    IOTC_CORE_BLE_LL_ERR_SVC_OPTYPE,
    IOTC_CORE_BLE_LL_ERR_CMD_DECODE,
    IOTC_CORE_BLE_LL_ERR_DATAMODE,
    IOTC_CORE_BLE_INVALID_PID,
    IOTC_CORE_BLE_INVALID_GATT_EVENT,
    IOTC_CORE_BLE_INVALID_SEQ,
    IOTC_CORE_BLE_UIDHASH_NOT_MATCH,
    IOTC_CORE_BLE_INVALID_AUTHCODE_ID,
    IOTC_CORE_BLE_DEVID_NOT_MATCH,
    IOTC_CORE_BLE_INVALID_SVC_UUID,
    IOTC_CORE_BLE_INVALID_CHAR_UUID,
    IOTC_CORE_BLE_ERR_SESSION_NOT_CREATE,
    IOTC_CORE_BLE_ERR_HMAC,
    IOTC_CORE_BLE_ERR_SESSION_ID,
    IOTC_CORE_BLE_NO_CONNECT,
    IOTC_CORE_BLE_ERR_CUSTOM_DATA_SIZE,

    /* 核心wifi模块错误码 [-327680,-262144) */
    IOTC_CORE_WIFI_TRANS_ERR_LINK_CREATE = ERR_CODE_BASE(IOTC_SUB_MODULE_CORE_WIFI),
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_TLS_CREATE,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_TLS_ALREADY_CONNECT,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_UDP_CREATE,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_UDP_INIT,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_UDP_ADDR,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_UDP_INVALID,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_UDP_NOT_CONNECT,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_CONNECT,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_INVALID,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_RECV_INVALID,
    IOTC_CORE_WIFI_TRANS_ERR_SOCKET_EXPEND_BUF_INVALID,
    IOTC_CORE_WIFI_TRANS_ERR_TLS_SOCKET_RECV,
    IOTC_CORE_WIFI_TRANS_ERR_LINK_NOT_CONNECT,
    IOTC_CORE_WIFI_TRANS_ERR_LINK_HAVE_CALLBACK,
    IOTC_CORE_WIFI_TRANS_ERR_SESS_SEND_COR,
    IOTC_CORE_WIFI_TRANS_ERR_SESS_RECV_COR,
    IOTC_CORE_WIFI_TRANS_ERR_SESS_CREATE,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_NO_URI,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_ENDPOINT_CREATE,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_ENDPOINT_REQ_LIST_FULL,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_ENDPOINT_SOURCE_NEW,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_UDP_HEADER_SHORT,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_UDP_TOKEN_SHORT,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_UDP_INVALID_VER,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_OPTION_BIG,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_OPTION_SHORT,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_OPTION_LONG,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_OPTION_NUM,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_OPTION_INVALID,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_EXT_SHORT,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_EXT_LONG,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_USE_RESERVED,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_INVALID_BUILD,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_BUILD_FUNC,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_BUFFER_SHORT,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_OPTION_ORDER,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_TCP_V1_HEADER_SHORT,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_TCP_V1_INVALID_VER,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_CODEC_PAYLOAD_INVALID,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_RETRANS_BUFFER_OVER_SIZE,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_RETRANS_NODE_NEW,
    IOTC_CORE_WIFI_TRANS_ERR_COAP_RETRANS_CHECK,

    IOTC_CORE_WIFI_NETCFG_ERR_SOFTAP_BUILD_RESP,
    IOTC_CORE_WIFI_NETCFG_ERR_SOFTAP_CREATE_BUFFER,
    IOTC_CORE_WIFI_NETCFG_ERR_SOFTAP_WATCH_FD,
    IOTC_CORE_WIFI_NETCFG_ERR_SOFTAP_INVALID_CTX,
    IOTC_CORE_WIFI_NETCFG_ERR_SOFTAP_INVALID_STATION,
    IOTC_CORE_WIFI_NETCFG_ERR_INVALID_E2E_CTRL_TYPE,
    IOTC_CORE_WIFI_NETCFG_ERR_E2E_CTRL_INVALID_SVC_NUM,
    IOTC_CORE_WIFI_NETCFG_ERR_E2E_CTRL_NO_DATA,
    IOTC_CORE_WIFI_NETCFG_ERR_E2E_CTRL_INVALID_PEER,

    IOTC_CORE_WIFI_LOCAL_CTL_ERR_INVALID_CLIENT_MAP,
    IOTC_CORE_WIFI_LOCAL_CTL_ERR_CREATE_CLIENT,
    IOTC_CORE_WIFI_LOCAL_CTL_ERR_INVALID_CLIENT,
    IOTC_CORE_WIFI_LOCAL_CTL_ERR_GET_EARLIEST_CLIENT,
    IOTC_CORE_WIFI_LOCAL_CTL_ERR_CREATE_BUFFER,

    IOTC_CORE_WIFI_LAN_SEARCH_ERR_CREATE_BUFFER,
    IOTC_CORE_WIFI_LAN_SEARCH_ERR_PEER_OVER_MAX_NUM,
    IOTC_CORE_WIFI_LAN_SEARCH_ERR_PEER_CREATE,
    IOTC_CORE_WIFI_LAN_SEARCH_ERR_PEER_INVALID,
    IOTC_CORE_WIFI_LAN_SEARCH_ERR_SPEKE_PROCESS,

    IOTC_CORE_WIFI_COMM_ERR_GET_RECV_BUFFER,
    IOTC_CORE_WIFI_COMM_ERR_GET_SEND_BUFFER,

    IOTC_CORE_WIFI_M2M_ERR_CLOUD_NO_AVAILABLE_URL,
    IOTC_CORE_WIFI_M2M_ERR_CLOUD_INVALID_CTX,
    IOTC_CORE_WIFI_M2M_ERR_CLOUD_WATCH_FD,
    IOTC_CORE_WIFI_M2M_ERR_CLOUD_GET_OPTION,
    IOTC_CORE_WIFI_M2M_ERR_CLOUD_GET_OPT_REQ_ID,
    IOTC_CORE_WIFI_M2M_ERR_CLOUD_GET_OPT_DEV_ID,
    IOTC_CORE_WIFI_M2M_ERR_CLOUD_GET_OPT_USER_ID,
    IOTC_CORE_WIFI_M2M_ERR_CLOUD_GET_OPT_SEQ_NUM_ID,

    IOTC_CORE_WIFI_DATA_ERR_GET_CUSTOM_SSID,
    IOTC_CORE_WIFI_DATA_ERR_GET_CUSTOM_CA,
    IOTC_CORE_WIFI_UTILS_ERR_CAN_NOT_REBOOT,

    IOTC_CORE_WIFI_E2E_CTL_ERR_GET_CHAR_NO_DATA,
    IOTC_CORE_WIFI_TRANS_BUFFER_ERR_CREATE,

    /* 核心profile模块错误码 [-262144,-196608) */
    IOTC_CORE_PROF_NETCFG_ERR_METHOD_OVERSIZE = ERR_CODE_BASE(IOTC_SUB_MODULE_CORE_PROFILE),
    IOTC_CORE_PROF_NETCFG_ERR_INVALID_TYPE,
    IOTC_CORE_PROF_MDL_ERR_DEV_INFO_EMPTY_MANU_NAME,
    IOTC_CORE_PROF_MDL_ERR_DEV_INFO_EMPTY_DEV_NAME,
    IOTC_CORE_PROF_MDL_ERR_DEV_INFO_INVALID_PRO_ID,
    IOTC_CORE_PROF_MDL_ERR_DEV_INFO_INVALID_SUB_PRO_ID,
    IOTC_CORE_PROF_MDL_ERR_DEV_INFO_INVALID_SN,
    IOTC_CORE_PROF_MDL_ERR_DEV_INFO_INVALID,
    IOTC_CORE_PROF_MDL_ERR_SVC_NUM_INVALID,
    IOTC_CORE_PROF_MDL_ERR_SVC_NO_SID,
    IOTC_CORE_PROF_MDL_ERR_SVC_NO_DATA,
    IOTC_CORE_PROF_MDL_ERR_JSON_ARRAY_2_CHAR_STATES,
    IOTC_CORE_PROF_MDL_ERR_BUILD_DEV_INFO_JSON,
    IOTC_CORE_PROF_SVC_ERR_UPLINK_FULL,
    IOTC_CORE_PROF_SVC_ERR_ASYNC_REPORT,

    /* 核心通用模块错误码 [-196608,-131072)*/
    IOTC_CORE_COMM_UTILS_ERR_EX_MUTEX_CREATE = ERR_CODE_BASE(IOTC_SUB_MODULE_CORE_INFRASTRUCTURE),
    IOTC_CORE_COMM_UTILS_ERR_LOCAL_MUTEX_CREATE,
    IOTC_CORE_COMM_UTILS_ERR_CAS_MUTEX_CREATE,
    IOTC_CORE_COMM_UTILS_ERR_BIT_MAP_CREATE,
    IOTC_CORE_COMM_UTILS_ERR_HASH_MAP_CREATE,
    IOTC_CORE_COMM_UTILS_ERR_QUEUE_FULL,
    IOTC_CORE_COMM_UTILS_ERR_QUEUE_EMPTY,
    IOTC_CORE_COMM_UTILS_ERR_QUEUE_VAL_TOO_LONG,
    IOTC_CORE_COMM_UTILS_ERR_MSG_QUEUE_NOT_ALLOW_PUSH,
    IOTC_CORE_COMM_UTILS_ERR_MSG_QUEUE_FULL,
    IOTC_CORE_COMM_UTILS_ERR_MSG_QUEUE_EMPTY,
    IOTC_CORE_COMM_UTILS_ERR_MSG_QUEUE_PUSH,
    IOTC_CORE_COMM_UTILS_ERR_MSG_QUEUE_POP,
    IOTC_CORE_COMM_UTILS_ERR_FSM_INVALID_STATE,
    IOTC_CORE_COMM_UTILS_ERR_FSM_CREATE,
    IOTC_CORE_COMM_UTILS_ERR_BUFFER_EXPEND_OVERSIZE,
    IOTC_CORE_COMM_UTILS_ERR_BUFFER_GET,
    IOTC_CORE_COMM_UTILS_ERR_BUFFER_CREATE,
    IOTC_CORE_COMM_UTILS_ERR_STR_DUP,
    IOTC_CORE_COMM_UTILS_ERR_MALLOC_COPY,
    IOTC_CORE_COMM_UTILS_ERR_HEXIFY,
    IOTC_CORE_COMM_UTILS_ERR_UNHEXIFY,
    IOTC_CORE_COMM_UTILS_ERR_JSON_CREATE_ERRCODE,
    IOTC_CORE_COMM_UTILS_ERR_JSON_INVALID_ERRCODE,
    IOTC_CORE_COMM_UTILS_ERR_JSON_MALLOC_PRINT,
    IOTC_CORE_COMM_UTILS_ERR_STORE_ALREADY_INIT,
    IOTC_CORE_COMM_UTILS_ERR_STORE_CREATE_NEW_NODE,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_LIST,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_KEY,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_BUF_SIZE,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_ITEM,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_KV_LEN,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_VERSION,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_CIPHER,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INTEGRITY_CHECK,
    IOTC_CORE_COMM_UTILS_ERR_STORE_INVALID_MODE,
    IOTC_CORE_COMM_UTILS_ERR_STORE_MAC_NOT_SAME,
    IOTC_CORE_COMM_UTILS_ERR_TIME_OVERFLOW,
    IOTC_CORE_COMM_UTILS_ERR_TIME_NOT_SYNC,
    IOTC_CORE_COMM_UTILS_ERR_TIME_GET_DATA,
    IOTC_CORE_COMM_UTILS_ERR_TIME_GET_WEEKDAY,

    IOTC_CORE_COMM_SEC_ERR_NO_AC_KEY,
    IOTC_CORE_COMM_SEC_ERR_NO_UDID,
    IOTC_CORE_COMM_SEC_ERR_NO_PSK_CALLBACK,
    IOTC_CORE_COMM_SEC_ERR_GET_AC_KEY,
    IOTC_CORE_COMM_SEC_ERR_GET_UDID,
    IOTC_CORE_COMM_SEC_ERR_GET_PSK,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_GET_PINCODE,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_NOTIFY_FINISH,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_NEGOCTX_INIT,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_RANDOM_GEN,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_TYPE,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_MSG_TYPE,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_OPCODE,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_VER_NOT_SUPP,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_PUBKEY,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_NEGOCTX_NOT_INIT,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_VERIFY_HMAC,
    IOTC_CORE_COMM_SEC_ERR_SPEKE_CREATE,
    IOTC_CORE_COMM_SEC_ERR_SESS_KEY_NOT_READY,

    IOTC_CORE_COMM_FWK_ERR_SOURCE_TIMER_MAX,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_TIMER_CREATE,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_FD_WATCH,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_FD_SUSPEND,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_FD_RESUME,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_FD_MAX,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_FD_CREATE,
    IOTC_CORE_COMM_FWK_ERR_LOOP_NODE_NEW,
    IOTC_CORE_COMM_FWK_ERR_LOOP_NEW,
    IOTC_CORE_COMM_FWK_ERR_LOOP_NOT_SUSPEND,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_NEW,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_QUEUE_SEND_MSG,
    IOTC_CORE_COMM_FWK_ERR_SOURCE_QUEUE_MSG_TOO_LONG,
    IOTC_CORE_COMM_FWK_ERR_MAIN_INVOKE_RESET_INVALID_TASK,
    IOTC_CORE_COMM_FWK_ERR_MAIN_INVOKE_STOP_INVALID_TASK,
    IOTC_CORE_COMM_FWK_ERR_MAIN_ALREADY_RUNNING,
    IOTC_CORE_COMM_FWK_ERR_SERVICE_MESSAGE_INVALID,
    IOTC_CORE_COMM_FWK_ERR_SERVICE_INVALID,
    IOTC_CORE_COMM_FWK_ERR_SERVICE_INSTANCE_INVALID,
    IOTC_CORE_COMM_FWK_ERR_SERVICE_SUB_MSG_SELF,
    IOTC_CORE_COMM_FWK_ERR_SERVICE_NO_API,
    IOTC_CORE_COMM_SCHED_ERR_EXECUTOR_SCHED_TASK_INVOKE,

    IOTC_CORE_COMM_DFX_WATCH_DOG_ERR_ADD,
    IOTC_CORE_COMM_DFX_WATCH_DOG_ERR_FEED,
    IOTC_CORE_COMM_DFX_WATCH_DOG_ERR_INIT,

    /* 适配层错误码 [-131072,-65536) */
    IOTC_ADAPTER_MEM_ERR_MALLOC = ERR_CODE_BASE(IOTC_SUB_MODULE_ADAPTER),
    IOTC_ADAPTER_MEM_ERR_CALLOC,

    IOTC_ADAPTER_OS_ERR_CREATE_TASK,
    IOTC_ADAPTER_OS_ERR_SUSPEND_TASK,
    IOTC_ADAPTER_OS_ERR_RESUME_TASK,
    IOTC_ADAPTER_OS_ERR_CREATE_SEM,
    IOTC_ADAPTER_OS_ERR_WAIT_SEM,
    IOTC_ADAPTER_OS_ERR_POST_SEM,
    IOTC_ADAPTER_OS_ERR_MUTEX_LOCK,
    IOTC_ADAPTER_OS_ERR_MUTEX_UNLOCK,
    IOTC_ADAPTER_OS_ERR_SLEEP,

    IOTC_ADAPTER_JSON_ERR_CREATE,
    IOTC_ADAPTER_JSON_ERR_DUPLICATE,
    IOTC_ADAPTER_JSON_ERR_PARSE,
    IOTC_ADAPTER_JSON_ERR_PRINT,
    IOTC_ADAPTER_JSON_ERR_ADD,
    IOTC_ADAPTER_JSON_ERR_TYPE,
    IOTC_ADAPTER_JSON_ERR_SIZE_OVERFLOW,
    IOTC_ADAPTER_JSON_ERR_GET_STRING,
    IOTC_ADAPTER_JSON_ERR_GET_OBJ,
    IOTC_ADAPTER_JSON_ERR_GET_NUM,
    IOTC_ADAPTER_JSON_ERR_GET_ARRAY_ITEM,

    IOTC_ADAPTER_CRYPTO_ERR_AES_GCM_ENC,
    IOTC_ADAPTER_CRYPTO_ERR_AES_GCM_DEC,
    IOTC_ADAPTER_CRYPTO_ERR_AES_CBC_SETUP,
    IOTC_ADAPTER_CRYPTO_ERR_AES_CBC_ENC,
    IOTC_ADAPTER_CRYPTO_ERR_AES_CBC_DEC,
    IOTC_ADAPTER_CRYPTO_ERR_AES_CCM_ENC,
    IOTC_ADAPTER_CRYPTO_ERR_AES_CCM_DEC,
    IOTC_ADAPTER_CRYPTO_ERR_BASE64_ENC,
    IOTC_ADAPTER_CRYPTO_ERR_DRBG_INIT,
    IOTC_ADAPTER_CRYPTO_ERR_RANDOM,
    IOTC_ADAPTER_CRYPTO_ERR_MD_CALC,
    IOTC_ADAPTER_CRYPTO_ERR_MD_UPDATE,
    IOTC_ADAPTER_CRYPTO_ERR_HMAC_CALC,
    IOTC_ADAPTER_CRYPTO_ERR_HKDF,
    IOTC_ADAPTER_CRYPTO_ERR_PKCS5_PBKDF2_HMAC,
    IOTC_ADAPTER_CRYPTO_ERR_MPI_INIT,
    IOTC_ADAPTER_CRYPTO_ERR_MPI_EXP_MOD,
    IOTC_ADAPTER_CRYPTO_ERR_MPI_SUB_INT,
    IOTC_ADAPTER_CRYPTO_ERR_MPI_READ_STRING,
    IOTC_ADAPTER_CRYPTO_ERR_MPI_WRITE_STRING,
    IOTC_ADAPTER_CRYPTO_ERR_MPI_READ_BINARY,
    IOTC_ADAPTER_CRYPTO_ERR_MPI_WRITE_BINARY,
    IOTC_ADAPTER_CRYPTO_ERR_RSA_PARAM_IMPORT,
    IOTC_ADAPTER_CRYPTO_ERR_RSA_VERIFY,
    IOTC_ADAPTER_CRYPTO_ERR_RSA_DEC,
    IOTC_ADAPTER_CRYPTO_ERR_RSA_ENC,

    IOTC_ADAPTER_TLS_ERR_NEW,
    IOTC_ADAPTER_TLS_ERR_SETUP,
    IOTC_ADAPTER_TLS_ERR_CONNECT,
    IOTC_ADAPTER_TLS_ERR_RECV,
    IOTC_ADAPTER_TLS_ERR_SEND,
    IOTC_ADAPTER_TLS_ERR_CLIENT_INVALID,
    IOTC_ADAPTER_TLS_ERR_CERT_VERIFY,

    IOTC_ADAPTER_KV_ERR_INIT,
    IOTC_ADAPTER_KV_ERR_SET_ITEM,
    IOTC_ADAPTER_KV_ERR_GET_ITEM,
    IOTC_ADAPTER_KV_ERR_CREATE_FILE,
    IOTC_ADAPTER_KV_ERR_CREATE_DIR,
    IOTC_ADAPTER_KV_ERR_DEL_FILE,
    IOTC_ADAPTER_KV_ERR_DEL_DIR,
    IOTC_ADAPTER_KV_ERR_OPEN_FILE,
    IOTC_ADAPTER_KV_ERR_STAT_FILE,

    IOTC_ADAPTER_SOCKET_ERR_DNS,
    IOTC_ADAPTER_SOCKET_ERR_FCNTL,
    IOTC_ADAPTER_SOCKET_ERR_SET_OPT,
    IOTC_ADAPTER_SOCKET_ERR_GET_OPT,

    IOTC_ADAPTER_NETWORK_ERR_GET_IP,
    IOTC_ADAPTER_NETWORK_ERR_GET_MAC,
    IOTC_ADAPTER_NETWORK_ERR_GET_BROADCAST_IP,

    IOTC_ADAPTER_SOFTAP_ERR_START,
    IOTC_ADAPTER_SOFTAP_ERR_STOP,

    IOTC_ADAPTER_WIFI_ERR_GET_INFO,
    IOTC_ADAPTER_WIFI_ERR_SET_INFO,
    IOTC_ADAPTER_WIFI_ERR_DISABLE,
    IOTC_ADAPTER_WIFI_ERR_ENABLE,
    IOTC_ADAPTER_WIFI_ERR_REMOVE,
    IOTC_ADAPTER_WIFI_ERR_ADD,
    IOTC_ADAPTER_WIFI_ERR_SCAN,
    IOTC_ADAPTER_WIFI_ERR_DISCONNECT,
    IOTC_ADAPTER_WIFI_ERR_CONNECT,
    IOTC_ADAPTER_WIFI_ERR_REGISTER_WIFI_EVENT,
    IOTC_ADAPTER_WIFI_ERR_SOFTAP_GET_STA_LIST,
    IOTC_ADAPTER_WIFI_ERR_SOFTAP_DISASSOCIATE_STA,
    IOTC_ADAPTER_WIFI_ERR_SOFTAP_ADD_TX_POWER,

    /* 公共错误码 [-65536,0) */
    IOTC_ERR_PARAM_INVALID = ERR_CODE_BASE(IOTC_SUB_MODULE_PUBLIC),
    IOTC_ERR_TIMEOUT,
    IOTC_ERR_NOT_SUPPORT,
    IOTC_ERR_NOT_INIT,
    IOTC_ERR_ALREADY_INIT,
    IOTC_ERR_CALLBACK_NULL,
    IOTC_ERR_CONTEXT_NULL,
    IOTC_ERR_SECUREC_STRCPY,
    IOTC_ERR_SECUREC_SPRINTF,
    IOTC_ERR_SECUREC_MEMCPY,
    IOTC_ERROR = -1,

    IOTC_OK = 0,
};

#ifdef __cplusplus
}
#endif

#endif /* IOTC_ERRCODE_H */